package com.youlv.yl.controller;

import com.youlv.yl.aop.ParamCheck;
import com.youlv.yl.dto.HotelOne;
import com.youlv.yl.dto.HotelQueryDto;
import com.youlv.yl.service.intf.HotelService;
import com.youlv.yl.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 酒店详情 前端控制器
 * </p>
 *
 * @author fenghe
 * @since 2022-01-05
 */
@RestController
@RequestMapping("/yl/hotel/")
@Api(value = "实现酒店的相关操作", tags = "实现酒店的相关操作")
/**  跨域*/
@CrossOrigin
public class HotelController {
    @Autowired
    private HotelService service;
    @PostMapping("query.do")
    public R query(@ParamCheck@RequestBody(required = false) HotelQueryDto hotel) {
        return service.selectHotel(hotel);
    }

    @GetMapping("queryAll.do")
    public R queryAll(@ParamCheck Integer tid) {
        return service.selectAll(tid);
    }

    @PostMapping("queryOne.do")
    public R queryOne(@ParamCheck@RequestBody HotelOne hotelOne) {
        return service.selectOne(hotelOne);
    }
}
